﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace RBAC.MaHaiBo.Repository.Migrations
{
    public partial class 深加工 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "Accessoriesid",
                table: "PlotInfo",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "Additiveid",
                table: "PlotInfo",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "PackingMaterialsid",
                table: "PlotInfo",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "RawMaterialid",
                table: "PlotInfo",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.CreateTable(
                name: "Accessories",
                columns: table => new
                {
                    Accessoriesid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LOT = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Uid = table.Column<int>(type: "int", nullable: false),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Accessories", x => x.Accessoriesid);
                });

            migrationBuilder.CreateTable(
                name: "Additive",
                columns: table => new
                {
                    Additiveid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LOT = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Uid = table.Column<int>(type: "int", nullable: false),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Additive", x => x.Additiveid);
                });

            migrationBuilder.CreateTable(
                name: "PackingMaterials",
                columns: table => new
                {
                    PackingMaterialsid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LOT = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Uid = table.Column<int>(type: "int", nullable: false),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PackingMaterials", x => x.PackingMaterialsid);
                });

            migrationBuilder.CreateTable(
                name: "RawMaterial",
                columns: table => new
                {
                    RawMaterialid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LOT = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Uid = table.Column<int>(type: "int", nullable: false),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RawMaterial", x => x.RawMaterialid);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Accessories");

            migrationBuilder.DropTable(
                name: "Additive");

            migrationBuilder.DropTable(
                name: "PackingMaterials");

            migrationBuilder.DropTable(
                name: "RawMaterial");

            migrationBuilder.DropColumn(
                name: "Accessoriesid",
                table: "PlotInfo");

            migrationBuilder.DropColumn(
                name: "Additiveid",
                table: "PlotInfo");

            migrationBuilder.DropColumn(
                name: "PackingMaterialsid",
                table: "PlotInfo");

            migrationBuilder.DropColumn(
                name: "RawMaterialid",
                table: "PlotInfo");
        }
    }
}
